<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="icon" href="status/favicon.ico">

    <title>VerneMQ Status</title>

    <!-- Bootstrap core CSS -->
    <link href="status/css/bootstrap.min.css" rel="stylesheet">
    <link href="status/css/vernemq.css" rel="stylesheet">

  </head>

  <body>

      <div class="container">
      <nav class="navbar navbar-expand-lg navbar-light justify-content-between">
          <a class="navbar-brand" href="#">
              <img src="status/img/logo.jpg" height="60" alt="">
          </a>
          <div>
          <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation">
              <span class="navbar-toggler-icon"></span>
          </button>
          <div class="collapse navbar-collapse" id="navbarNavAltMarkup">
              <div class="navbar-nav">
              <a class="p-2" target="_blank" href="https://docs.vernemq.com">Docs</a>
              <a class="p-2" target="_blank" href="https://vernemq.com/contact.html">Support</a>
              <a class="p-2" target="_blank" href="https://github.com/vernemq/vernemq">Github</a>
              <a class="p-2" target="_blank" href="https://twitter.com/vernemq">Twitter</a>
              </div>
          </div>
          </div>
      </nav>
      </div>
      <!--
      <div class="d-flex flex-column flex-md-row align-items-center p-3 px-md-4 mb-3 bg-white ">
          <h5 class="my-0 mr-md-auto font-weight-normal">VerneMQ Status</h5>
          <nav class="my-2 my-md-0 mr-md-3">
          </nav>
      </div>
      -->
      <div id="node_list"></div>
          <script id="node_list_template" type="x-tmpl-mustache">
<div class="container">
    <div class="row mt-5">
        <div class="col-md-12 mb-3">

        {{#cluster_issues.length}}
        <h5>Issues</h5>
        <div class="table-responsive">
            <table class="table table-striped table-bordered bg-light">
                <thead>
                    <tr>
                    <th scope="col">Node</th>
                    <th scope="col" class="max-width">Message</th>
                    </tr>
                </thead>
                <tbody>
                    {{#cluster_issues}}
                    <tr>
                        <td><strong>{{node}}</strong></td>
                        <td class="text-nowrap"><span class="badge badge-{{type}}">{{type}}</span> {{{message}}}</td>
                    </tr>
                    {{/cluster_issues}}
                </tbody>
            </table>
        </div>
        {{/cluster_issues.length}}
        {{^cluster_issues.length}}
        <div class="alert alert-success" role="alert">
        <strong>All good! No cluster issues found!</strong>
        </div>
        {{/cluster_issues.length}}
        </div>
    </div>
    <div class="row">
        <div class="col-md-12 mb-3">
            <h5>Cluster Overview</h5>
            <div class="table-responsive">
                <table class="table table-striped table-bordered bg-light">
                    <thead>
                        <tr>
                        <th scope="col" class="text-center">Cluster Size</th>
                        <th scope="col" class="text-center">Clients online</th>
                        <th scope="col" class="text-center">Clients offline</th>
                        <th scope="col" class="text-center">Connect Rate</th>
                        <th scope="col" class="text-center">Publish In Rate</th>
                        <th scope="col" class="text-center">Publish Out Rate</th>
                        <th scope="col" class="text-center">Msg Drop Rate</th>
                        <th scope="col" class="text-center">Msg Queued</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td class="text-center">{{cluster_size}}</td>
                            <td class="text-center">{{total.clients_online}}</td>
                            <td class="text-center">{{total.clients_offline}}</td>
                            <td class="text-center">
                                {{total.connect_rate}} <small class="text-tiny">sec</small>
                            </td>
                            <td class="text-center">
                                {{total.msg_in_rate}} <small class="text-tiny">sec</small>
                            </td>
                            <td class="text-center">
                                {{total.msg_out_rate}} <small class="text-tiny">sec</small>
                            </td>
                            <td class="text-center">
                                {{total.msg_drop_rate}} <small class="text-tiny">sec</small>
                            </td>
                            <td class="text-center">{{total.msg_queued}}</td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-md-12 mb-3">

        <h5>Node Status</h5>
        <div class="table-responsive">
            <table class="table table-striped table-bordered bg-white">
                <thead>
                    <tr>
                    <th scope="col" class="max-width">Node</th>
                    <th scope="col" class="text-center">Clients</th>
                    <th scope="col" class="text-center">Connect Rate</th>
                    <th scope="col" class="text-center">Publish In Rate</th>
                    <th scope="col" class="text-center">Publish Out Rate</th>
                    <th scope="col" class="text-center">Msg Drop Rate</th>
                    <th scope="col" class="text-center">Msg Queued</th>
                    <th scope="col" class="text-center">Subscriptions</th>
                    <th scope="col" class="text-center">Retained</th>
                    </tr>
                </thead>
                <tbody>
                {{#nodes}}
                    <tr>
                        <td class="text-nowrap">
                            <strong>
                                {{node}} <span class="badge badge-secondary">{{version}}</span>
                            </strong>
                            <br/>
                            <small class="text-tiny">
                                Protocols:
                                {{#listeners}}
                                    <span class="badge badge-primary">{{.}}</span>
                                {{/listeners}}
                                {{^listeners}}
                                    <span class="badge badge-warning">No MQTT listener</span>
                                {{/listeners}}
                            </small>
                            <br/>
                            <small class="text-tiny">
                                Reachable peers:
                                {{#cluster_view.not_ready}}
                                <span class="badge badge-warning">{{cluster_view.ready.length}} of {{cluster_view.num_nodes}}</span>
                                {{/cluster_view.not_ready}}
                                {{^cluster_view.not_ready}}
                                <span class="badge badge-success">{{cluster_view.ready.length}} of {{cluster_view.num_nodes}}</span>
                                {{/cluster_view.not_ready}}
                            </small>
                            <br/>
                            <small class="text-tiny">
                                Routing score:
                                <span class="badge badge-secondary">{{routing_score}}</span>
                            </small>

                        </td>
                        <td class="text-center">
                            {{clients_online}} <small class="text-tiny">online</small>
                            <br/>
                            {{clients_offline}} <small class="text-tiny">offline</small>
                        </td>
                        <td class="text-center">
                            {{connect_rate}} <small class="text-tiny">sec</small>
                        </td>
                        <td class="text-center">
                            {{msg_in_rate}} <small class="text-tiny">sec</small>
                        </td>
                        <td class="text-center">
                            {{msg_out_rate}} <small class="text-tiny">sec</small>
                        </td>
                        <td class="text-center">
                            {{msg_drop_rate}} <small class="text-tiny">sec</small>
                        </td>
                        <td class="text-center">{{msg_queued}}</td>
                        <td class="text-center">{{subscriptions}}</td>
                        <td class="text-center">{{retained}}</td>
                    </tr>
                {{/nodes}}
                </tbody>
            </table>
        </div>
    </div>
</div>
</div>
          </script>
      </div>


    <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="status/js/jquery-3.5.1.min.js"></script>
    <script src="status/js/bootstrap.min.js"></script>
    <script src="status/js/mustache.min.js"></script>
    <script src="status/js/status.js"></script>
  </body>
</html>

